package com.teamin.service.impl.wx;

import com.alibaba.fastjson.JSONObject;
import com.teamin.web.https.http.HttpRequest;

public class SmallMenuMain {

	public static void main(String[] args) {

		String url = "https://api.weixin.qq.com/cgi-bin/menu/create?access_token=e66VjF75HKg-7_JV5Yfpa1YFueWtfx8BELhr2QspYljwH9mxWwrIIQLk61tyEq3Jq0snTnSSRvK1AzdLH8XNDHiHjmIFQ4L80cTE9wuGuCZu4XAfemo7iFbd8iweR6dKXTFiAFAPLX";
		String jsonMenu = "{\"button\": [ "
				+ "{\"type\": \"view\",  \"name\": \"工作台\",   \"url\": \"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx9dfb1f02fa4431b1&redirect_uri=https://app.teamin.cc/m/mobile/page/landing.html&response_type=code&scope=snsapi_userinfo&state=257\" },"
				+ " {\"type\": \"click\", \"name\": \"联系我们\",\"key\": \"contactus\"}"
				+ "]}";


		//小程序公众号
		String smallJsonMenu = "{\"button\": [ {\"type\":\"miniprogram\",\"name\":\"小程序入口\",\"url\":\"https://app.teamin.cc/litepc\",\"appid\":\"wx3455211af04c94db\",\"pagepath\":\"pages/setting\"},"+
			"{\"name\":\"联系我们\",\"sub_button\":["+
				"{\"type\":\"click\",\"name\":\"客服咨询\",\"url\":\"https://app.teamin.cc/litepc\",\"key\":\"customer_service\"},"+
					"{\"type\":\"click\",\"name\":\"版本更新\",\"url\":\"https://app.teamin.cc/litepc\",\"key\":\"version_update\"},"+
						"{\"type\":\"click\",\"name\":\"关于我们\",\"url\":\"https://app.teamin.cc/litepc\",\"key\":\"about_us\"}]};";


//		String url = "https://api.weixin.qq.com/cgi-bin/menu/create?access_token=FvAjHIVGlVk6Wb6y3ev4QmKDOT6TqGEo9IPr0V3sYiojTfJFAHCR3syRa4-kSm2MMMTnR-2bUgS6P6BCnnamoJ9irJFPivmJxwDoCTSmSNQTSadB31oLb2iJdASN1iPOWFKiAFASBG";
//		String jsonMenu = "{\"button\": [ "
//				+ "{\"type\": \"view\",  \"name\": \"工作台\",   \"url\": \"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx05ba4c235b9543e9&redirect_uri=http://test.teamin.cc/mobile/page/landing.html&response_type=code&scope=snsapi_userinfo&state=257\" },"
//				+ " {\"type\": \"click\", \"name\": \"联系我们\",\"key\": \"contactus\"}"
//				+ "]}";
		JSONObject jsonObject = HttpRequest.request(url, "POST", smallJsonMenu);
		System.out.println(jsonObject.toString());

		// String url2 = "http://localhost:8080/Parking/CoreServlet";
		// String jsonMenu2 =
		// "<xml><ToUserName><![CDATA[gh_4dcba4cbf3ed]]></ToUserName><FromUserName><![CDATA[oXsrqsmDi-avOWfAzzLicfWRtX64]]></FromUserName><CreateTime>1446193480</CreateTime><MsgType><![CDATA[event]]></MsgType><Event><![CDATA[VIEW]]></Event><EventKey><![CDATA[http://service.danke360.com/Parking/main.jsp]]></EventKey></xml>";
		//
		//
		// JSONObject jsonObject2 = WeixinUtil.httpRequesthTTP(url2, "POST",
		// jsonMenu2);
		// System.out.println(jsonObject2.toString());
	}
}
//http://192.168.3.8/wechat/page/index.htm